import { Room } from 'src/room/entities/room.entity';
import {
  Column,
  Entity,
  JoinColumn,
  ManyToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity({ name: 'photo' })
export class Photo {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  url: string;

  @Column()
  key: string;

  @ManyToOne((typr) => Room, (room) => room.photos)
  @JoinColumn({ name: 'room_id' })
  room: Room;
}
